home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Palettes / PSAction / palette.make_3.0 < prev    next >
Text File  |  1995-06-12  |  3KB  |  95 lines

  1. #
  2. #                               palette.make
  3. #
  4. # Inputs from Makefile.preamble or Makefile.postamble (no defaults):
  5. #    OTHER_CFLAGS - Flags passed to compiler (in addition to -g, -O, etc.)
  6. #    OTHER_LDFLAGS - Flags passed to ld (in addition to -ObjC, etc.)
  7. #    OTHER_OFILES - Additional relocatables that may be linked in
  8. #    OTHER_PRODUCT_DEPENDS - Other dependencies of this project
  9. #    OTHER_SOURCEFILES - Other source files maintained by .pre/postamble
  10. #    OTHER_GARBAGE - Additional files to be removed by make 'clean' 
  11. #
  12. #    DSTROOT - Virtual root directory prepended to $(INSTALLDIR)
  13. #
  14. # Inputs from Makefile.preamble (no defaults):
  15. #    PRECOMPS - Precompiled headers that should be built before compilation 
  16. #    OTHER_INITIAL_TARGETS - Targets to be built before subprojects, etc.
  17. #
  18. # Inputs from Makefile.postamble (with defaults set in common.make):
  19. #    MAKEFILES - Makefiles this project depends on (default = Makefile)
  20. #    DEFAULT_CFLAGS - Set of CFLAGS used in compiling (default set below)
  21. #
  22. # Inputs from Makefile (avoid setting these, ProjectBuilder controls them):
  23. #    NAME - name of application
  24. #    LANGUAGE - langage in which the project is written (default "English")
  25. #    LOCAL_RESOURCES - localized resources (e.g. nib's, images) of project
  26. #    GLOBAL_RESOURCES - non-localized resources of project
  27. #
  28. #    CLASSES - Class implementation files in project.
  29. #    HFILES - Header files in project.
  30. #    MFILES - Other Objective-C source files in project. 
  31. #    CFILES - Other C source files in project. 
  32. #    PSWFILES - .psw files in the project
  33. #    PSWMFILES - .pswm files in the project
  34. #    SUBPROJECTS - Subprojects of this project
  35. #    BUNDLES - Bundle subprojects of this project
  36. #    OTHERSRCS - Other miscellaneous sources of this project
  37. #    OTHERLINKED - Source files not matching a standard source extention
  38. #    OTHERLINKEDOFILES - Other relocatable files to (always) link in.
  39. #    MAKEFILEDIR - Directory in which to find this generic set of Makefiles
  40. #
  41. #
  42. # Outputs to common.make:
  43. #    OFILE_DIR
  44. #    DERIVED_FILES
  45. #    PRODUCT_ROOT
  46.  
  47. OFILE_DIR = obj
  48. DERIVED_FILES = $(NAME) $(OFILE_DIR)
  49. PRODUCT_ROOT = $(NAME).palette
  50.  
  51. CFLAGS = -g -O -Wall   # palettes are standalone, so this must be set
  52. DEFAULT_CFLAGS = $(CFLAGS) $(OTHER_CFLAGS)
  53.  
  54. include $(MAKEFILEDIR)/common.make
  55.  
  56. # Rewrite various rules to simulate a 'debug' for the standalone case
  57.  
  58. .c.o:
  59.     $(CC) $(DEFAULT_CFLAGS) -c $*.c -o $(OFILE_DIR)/$*.o
  60. .m.o:
  61.     $(CC) $(DEFAULT_CFLAGS) $(OBJCFLAGS) -c $*.m -o $(OFILE_DIR)/$*.o
  62. .psw.o:
  63.     $(PSWRAP) $(PSWFLAGS) -a -h $*.h -o $*.c $*.psw
  64.     $(CC) $(DEFAULT_CFLAGS) -c $*.c -o $(OFILE_DIR)/$*.o
  65. .pswm.o:
  66.     $(PSWRAP) $(PSWFLAGS) -a -h $*.h -o $*.m $*.pswm
  67.     $(CC) $(DEFAULT_CFLAGS) $(OBJCFLAGS) -c $*.m -o $(OFILE_DIR)/$*.o
  68.  
  69.  
  70. all:: project
  71.  
  72. project:: $(INITIAL_TARGETS) subcomponents resources $(PRODUCT_ROOT)/$(NAME)
  73.  
  74. $(PRODUCT_ROOT):
  75.     @$(MKDIRS) $(PRODUCT_ROOT)
  76.  
  77. $(PRODUCT_ROOT)/$(NAME): $(OFILE_DIR) $(PRODUCT_DEPENDS) $(PRODUCT_ROOT)
  78.     $(LD) -r $(PALETTELDFLAGS) -o $(PRODUCT_ROOT)/$(NAME) $(OFILES) $(OTHER_OFILES) $(OTHERLINKED)
  79.     $(CHMOD) a+x $(PRODUCT_ROOT)/$(NAME)
  80.  
  81. $(DSTROOT)$(INSTALLDIR):
  82.     @$(MKDIRS) $(DSTROOT)$(INSTALLDIR)
  83.  
  84. before_install:: $(DSTROOT)$(INSTALLDIR)
  85.     $(RM) -rf $(DSTROOT)$(INSTALLDIR)/$(PRODUCT_ROOT)
  86.  
  87. after_install::
  88.  
  89. install:: $(PRODUCT_ROOT) before_install $(OTHER_INSTALL_DEPENDS)
  90.     $(TAR) cf - $(PRODUCT_ROOT) | (cd $(DSTROOT)$(INSTALLDIR); $(TAR) xf -)
  91.     @$(MAKE) after_install
  92.  
  93. depend:: Makefile.dependencies $(SUBPROJECTS:.subproj=.depend) $(BUNDLES:.bproj=.depend)
  94.  
  95.